from django.contrib import admin

class Admin(admin.ModelAdmin):
    # constructor
    def constructor(self, model, admin_site):
        super().__init__(model, admin_site)


def DjangoModelAdmin(field_names):
    # creating class dynamically
    return type(
        "admin" + str("".join(field_names)),
        (Admin,),
        {
            "__init__": Admin.constructor,
            # data members
            "list_display": field_names,
            # member functions
        },
    )


# # creating objects
# obj = DjangoModelAdmin(["id", "name"])
# print("aa", obj)
